<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>lightColor</title>
    <style>
        .test {
            color: #2396ef;
        }
    </style>
</head>

<body>
    <div id="test" class="test">原本是#2396ef的字体色变亮了</div>
    <script>
        const lightColor = (color, n = 1.6) => {
            const everyLightColor = subColor => {
                const value = Math.round(parseInt(subColor, 16) * n);
                return Math.min(255, Math.max(value, 16)).toString(16);
            };
            const resColor = [color.slice(1, 3), color.slice(3, 5), color.slice(5, 7)].reduce((res, item) => res += everyLightColor(item), '')
            return `#${resColor}`;
        };
        const test = document.querySelector('#test');
        test.style.color = lightColor('#2396ef');
    </script>
</body>

</html>